<?php
/**
 * Created by PhpStorm.
 * User: 13469
 * Date: 2018/10/8
 * Time: 15:06
 */
include "config.php";
session_start();
$result=array("status"=>0,"msg"=>"您还未登录,请先登录");
if($_SERVER["REQUEST_METHOD"]=="POST") {
    if (isset( $_SESSION["userinfo"])) {
        //登录了
        $result["status"]=1;
        $result["msg"]="欢迎您";
        $result["data"]=$_SESSION["userinfo"];
        print_r(json_encode($result));
    } else {
        //没登录
        print_r(json_encode($result));
    }
}